/**
 * @param {number[]} nums
 * @return {number}
 */
var sumDigitDifferences = function(nums) {
  let result = 0
  let hash = {}
  for (let index = 0; index < nums.length; index++) {
    let a = nums[index].toString()

    for(let j = 0; j < a.length; j++) {
      let num = a[j]
      if (!hash[j]) {
        hash[j] = {}
      }
      if (!hash[j][num]) {
        hash[j][num] = 1
      } else {
        hash[j][num]++
      }
    }
  }

  

  console.log(hash)
  
  return result
};
